<template>
	<!-- 管理审核 -->
	<view class="review">
		<view class="review-title">审核管理</view>
		<view class="review-main">
			<!-- <view class="reviewMain-content" @tap="inrecharge(0)">
				<view class="reviewMainImg">
					<image src="https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/manage-recharge.png"
						mode=""></image>
				</view>
				<view class="recharge">充值</view>
				<view class="icon iconfont icon-xiangyoujiantou"></view>
			</view> -->
			<view class="reviewMain-content" @tap="inrecharge(1)">
				<view class="reviewMainImg">
					<image src="https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/thaw.png" mode="">
					</image>
				</view>
				<view class="recharge">冻结与解冻</view>
				<view class="icon iconfont icon-xiangyoujiantou"></view>
			</view>
			<view class="reviewMain-content" @tap="inrecharge(2)">
				<view class="reviewMainImg">
					<image src="https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/delete.png" mode="">
					</image>
				</view>
				<view class="recharge">删除</view>
				<view class="icon iconfont icon-xiangyoujiantou"></view>
			</view>
			<view class="reviewMain-content" @tap="inrecharge(3)">
				<view class="reviewMainImg">
					<image src="https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/check-apply.png"
						mode=""></image>
				</view>
				<view class="recharge recharge-end">审核申请</view>
				<view class="icon iconfont icon-xiangyoujiantou"></view>
			</view>
		</view>
		<reviewPopup v-if="isPopup" :isPopup="isPopup" :popValueIndex="popValueIndex" @changeData="hidePopup"></reviewPopup>
		<!-- <tabBar currentPage="review"></tabBar> -->
		<view class="statistics">
			<view class="statistics-title">平台统计</view>
			<view class="statistics-box1">
				<view class="box1-text">
					<view class="round red"></view>
					<view class="text">用户：</view>
					<view class="count">{{statisticsList.userCount}}人</view>
				</view>
				<view class="box1-text">
					<view class="round green"></view>
					<view class="text">回收员：</view>
					<view class="count">{{statisticsList.collectorCount}}人</view>
				</view>
				<view class="box1-text">
					<view class="round blue"></view>
					<view class="text">合伙人：</view>
					<view class="count">{{statisticsList.partnerCount}}人</view>
				</view>
				<view class="box1-text">
					<view class="round yellow"></view>
					<view class="text">回收站：</view>
					<view class="count">{{statisticsList.packCount}}个</view>
				</view>
			</view>
			<view class="statistics-box1">
				<view class="box1-text">
					<view class="round red"></view>
					<view class="text">回收站今日订单：</view>
					<view class="count">{{statisticsList.collectorOrderDay}}单</view>
				</view>
				<view class="box1-text">
					<view class="round green"></view>
					<view class="text">回收站累计总单：</view>
					<view class="count">{{statisticsList.collectorOrderTotal}}单</view>
				</view>
				<view class="box1-text">
					<view class="round blue"></view>
					<view class="text">今日回收订单：</view>
					<view class="count">{{statisticsList.packOrderDay}}单</view>
				</view>
				<view class="box1-text">
					<view class="round yellow"></view>
					<view class="text">累计回收总单：</view>
					<view class="count">{{statisticsList.packOrderTotal}}单</view>
				</view>
			</view>
			<view class="statistics-box1">
				<view class="box1-text">
					<view class="round red"></view>
					<view class="text">今日新增用户：</view>
					<view class="count">{{statisticsList.userCountDay}}人</view>
				</view>
				<view class="box1-text">
					<view class="round green"></view>
					<view class="text">本周新增用户：</view>
					<view class="count">{{statisticsList.userCountWeek}}人</view>
				</view>
			</view>
			<view class="statistics-box1">
				<view class="box1-text">
					<view class="round red"></view>
					<view class="text">合伙人今日支出：</view>
					<view class="count">{{statisticsList.partnerDay}}回收币</view>
				</view>
				<view class="box1-text">
					<view class="round green"></view>
					<view class="text">合伙人累计总支出：</view>
					<view class="count">{{statisticsList.partnerTotal}}回收币</view>
				</view>
			</view>
			<!-- 底部tabbar导航 -->
			<!-- <tabBar currentPage="statistics"></tabBar> -->
		</view>
	</view>
</template>

<script>
	import tabBar from "@/component/count/tabbar.vue"
	import reviewPopup from "@/component/popupReview.vue"
	import util from '@/component/commen/api/util.js';
	export default {
		components: {
			tabBar,reviewPopup
		},
		data() {
			return {
				isPopup:false,//是否显示弹框
				popValueIndex:"",//传递给子组件的值
				statisticsList:"",//平台统计数据
			};
		},
		onShow() {
			this.getStainfo()
		},
		methods: {
			inrecharge(e) { //点击充值
				// console.log(e)
				this.popValueIndex = e
				// console.log(this.popValueIndex)
				this.isPopup = true
			},
			hidePopup(e) { //关闭遮罩，子组件传递数值
				// console.log(e)
				// 子组件传递false过来，关闭弹框
				this.isPopup = e
			},
			getStainfo(){//获取统计数据
				var params = {
				    do:"admin",
				    op:"platformStats",
				}
				util.requestWithSign(params).then(res=>{
					this.statisticsList = res.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.review {
		padding: 20rpx;
		.review-title{
			font-size: 32rpx;
			font-weight: bold;
			margin: 30rpx 0;
		}
		.review-main {
			background: #fff;
			padding: 20rpx 40rpx;
			padding-top: 0;
			box-sizing: border-box;
			border-radius: 30rpx;

			.reviewMain-content {
				padding-top: 20rpx;
				display: flex;
				align-items: center;
				font-size: 32rpx;

				.reviewMainImg {
					margin-right: 20rpx;
					width: 55rpx;
					height: 55rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.recharge {
					width: 85%;
					padding: 35rpx 0;
					border-bottom: 2rpx solid #ececec;
				}

				.recharge-end {
					border: 0;
				}

				.icon-xiangyoujiantou {
					margin-left: auto;
				}
			}
		}
		.statistics{
			// padding: 0 20rpx;
			padding-bottom: 150rpx;
			.statistics-title{
				margin: 30rpx 0;
				// padding:0 20rpx;
				// box-sizing: border-box;
				font-size: 32rpx;
				font-weight: bold;
			}
			.statistics-box1{
				padding: 20rpx 0 40rpx 0;
				margin-top: 20rpx;
				box-sizing: border-box;
				background: #fff;
				border-radius: 30rpx;
				.box1-text{
					padding-left: 120rpx;
					display: flex;
					align-items: center;
					margin-top: 30rpx;
					.round{
						margin-right: 20rpx;
						width: 17rpx;
						height: 17rpx;
						border-radius: 50%;
						// padding: 20rpx 0;
						box-sizing: border-box;
					}
					.red{
						background: #ff6a6a;
					}
					.green{
						background: #56db95;
					}
					.blue{
						background: #6ac3ff;
					}
					.yellow{
						background: #ffa66a;
					}
					.text{
						margin-right: 10rpx;
					}
					.count{
						font-weight: bold;
						font-size: 30rpx;
					}
				}
			}
		}
	}
</style>